]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
wanda: fix a refactor fallout
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 27 Nov 2012 17:12:44 +0000 (12:12 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 27 Nov 2012 17:56:40 +0000 (12:56 -0500)
load_sliced_image() would need an additional parameter, but fold the
notify::mapped callback into the load callback while we're at it.

js/ui/wanda.js

index 31b940d2e601aac702745b7e3755217b7dbe7049..28522330323c31ef3774b4aeca18580c517fd74d 100644 (file)
@@ -53,18 +53,19 @@ const WandaIcon = new Lang.Class({
                                  icon_size: iconSize });
         }
 
-        this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
-        this._animations.connect('notify::mapped', Lang.bind(this, function() {
-            if (this._animations.mapped && !this._timeoutId) {
-                this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update));
-
-                this._i = 0;
-                this._update();
-            } else if (!this._animations.mapped && this._timeoutId) {
-                GLib.source_remove(this._timeoutId);
-                this._timeoutId = 0;
-            }
-        }));
+        this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile,
+            this._imgWidth, this._imgHeight, Lang.bind(this,
+                function() {
+                    if (this._animations.mapped && !this._timeoutId) {
+                        this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update));
+
+                        this._i = 0;
+                        this._update();
+                    } else if (!this._animations.mapped && this._timeoutId) {
+                        GLib.source_remove(this._timeoutId);
+                        this._timeoutId = 0;
+                    }
+                }));
 
         return this._animations;
     },